package com.addplus.townmall.server.api.mapper.authority;

import com.addplus.townmall.server.api.model.authority.RoleMenuElement;
import com.addplus.townmall.server.api.utils.BaseAddMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMenuElementMapper extends BaseAddMapper<RoleMenuElement> {

   List<RoleMenuElement> getRoleMenuElement(@Param("rds") List<String> rds);

   @Update("UPDATE role_menuelement SET is_delete = 1 WHERE e_id =#{eId} AND is_delete = 0")
   Integer updateRoleMenuElementDeleteByeId(@Param("eId") Integer eid);

   Integer updateLogicallyDeleteBymenuElementId(@Param("rds") List<Integer> mid);

   @Update("UPDATE role_menuelement SET is_delete = 1 WHERE r_id =#{rId} AND is_delete = 0")
   Integer updateLogicallyDeleteByRoleId(@Param("rId") Integer rId);

}